<form id="report-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <input type="hidden" name="allocation_id" value="{$allocation.id}">
    
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">分工任务信息</h3>
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="col-md-6">
                    <p><strong>订单号：</strong>{$allocation.order.order_no}</p>
                    <p><strong>产品名称：</strong>{$allocation.model.product.name}</p>
                    <p><strong>产品型号：</strong>{$allocation.model.name}</p>
                </div>
                <div class="col-md-6">
                    <p><strong>工序名称：</strong>{$allocation.process.name}</p>
                    <p><strong>分配数量：</strong>{$allocation.quantity}</p>
                    <p><strong>已报工数量：</strong>{$allocation.reported_quantity|default='0'}</p>
                    <p><strong>剩余数量：</strong><span class="text-danger">{$allocation.quantity - $allocation.reported_quantity}</span></p>
                </div>
            </div>
        </div>
    </div>
    
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">提交报工</h3>
        </div>
        <div class="panel-body">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">报工数量：</label>
                <div class="col-xs-12 col-sm-8">
                    <input type="number" name="reported_quantity" class="form-control" data-rule="required;number" min="1" max="{$allocation.quantity - $allocation.reported_quantity}" placeholder="请输入本次报工数量">
                </div>
            </div>
            
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">实际用时：</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group">
                        <input type="number" name="actual_hours" class="form-control" data-rule="required;number" min="0" step="0.1" placeholder="请输入实际用时">
                        <span class="input-group-addon">小时</span>
                    </div>
                </div>
            </div>
            
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">质量状态：</label>
                <div class="col-xs-12 col-sm-8">
                    <select name="quality_status" class="form-control" data-rule="required">
                        <option value="">请选择质量状态</option>
                        <option value="1">合格</option>
                        <option value="2">不合格</option>
                        <option value="3">返工</option>
                    </select>
                </div>
            </div>
            
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">备注：</label>
                <div class="col-xs-12 col-sm-8">
                    <textarea name="remark" class="form-control" rows="3" placeholder="请输入备注信息"></textarea>
                </div>
            </div>
            
            <div class="form-group layer-footer">
                <label class="control-label col-xs-12 col-sm-2"></label>
                <div class="col-xs-12 col-sm-8">
                    <button type="submit" class="btn btn-success btn-embossed disabled">提交报工</button>
                    <button type="reset" class="btn btn-default btn-embossed">重置</button>
                </div>
            </div>
        </div>
    </div>
</form>
